<?php
/**
 * Created by PhpStorm.
 * User: lenvo
 * Date: 2018/7/11
 * Time: 23:33
 */

namespace app\merchant\service;


use app\common\service\Service;
use think\Db;

class Area extends Service
{
    public function getChild($pid = 0){
        $res = Db::name("Area")->where("pid",$pid)
            ->field("id,name")->select();
        if($res) {
            return $this->ret->setCode(\app\merchant\define\Merchant::$Code_Mer_Success)
                ->setMsg(\app\merchant\define\Merchant::$Msg_Mer_Success)
                ->setData("area",$res);
        }else {
            return $this->ret->setCode(\app\merchant\define\Merchant::$Code_Mer_Error)
                ->setMsg(\app\merchant\define\Merchant::$Msg_Mer_No_Area);
        }
    }
}